package com.cmwa.solution.sys.attach.entity;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.type.Alias;

import com.cmwa.solution.base.entity.BaseVo;
import com.cmwa.solution.utils.cached.DictionaryCached;
import com.cmwa.solution.utils.cached.EmployeeCached;

import cn.afterturn.easypoi.excel.annotation.Excel;

/**
 * @author zhengqq
 * @date 2018-09-03
 */
@Alias("attachVo")
public class AttachVo extends BaseVo {

	@Excel(name = "附件ID")
	private String attId; // PK

	@Excel(name = "附件名称")
	private String attName; // 名称

	private String attStoreType; // 附件存储类型(ATT_SAV_TYP)

	@Excel(name = "历史存放路径")
	private String oldAttPath; // 存放路径(修改前)

	@Excel(name = "新存放路径")
	private String attPath; // 存放路径

	private byte[] attBlob; // 存放到Blob

	private String attClob; // 存放到Clob

	private String createId; // 经办人ID
	
	private String createName;// 经办人名称

	private String createTime; // 经办时间

	private String stat; // 状态

	private String isOK;// 记录上传是否成功标志

	@Excel(name = "结果")
	private String errorMessage;// 记录上传是错误的信息
	
	private String attRelId;//附件关联关系id
	
	private String relId;//关联id
	
	private String relType; //关联类型
	
	/**
	 * 附件来源类型
	 */
	private String resourceSign;

	/**
	 * 附件来源类型
	 */
	private String resourceSignName;
	
	/**
	 * 附件来源ID
	 */
	private String resourceId;
	
	/**
	 * 来源类型
	 */
	private String resourceType;
	
	/**
	 * 文档分类ID
	 */
	private String documentTypeId;
	/**
	 * 文档分类名称
	 */
	private String documentTypeNm;
	/**
	 * 附件来源主体
	 */
	private String resourceSignModule;
	/**
	 * 系列产品编码
	 */
	private String prjCode;
	/**
	 * 系列产品简称
	 */
	private String prjSName;
	/**
	 * 产品编码
	 */
	private String prdCode;
	/**
	 * 产品简称
	 */
	private String prdsname;
	/**
	 * 拓展主键
	 */
	private String extId;
	/**
	 * 拓展字段名
	 */
	private String attrName;
	/**
	 * 拓展字段值
	 */
	private String attrValue;
	/**
	 * 估值日期REPORT_TIME
	 */
	private String reportTime;
	
	private List<AttachRelExtVo> extList;
	
	public List<AttachRelExtVo> getExtList() {
		return extList;
	}

	public void setExtList(List<AttachRelExtVo> extList) {
		this.extList = extList;
	}

	public String getCreateName() {
		if (StringUtils.isNotBlank(createId)) {
			return EmployeeCached.getName(createId);
		}
		return createName;
	}

	public void setCreateName(String createName) {
		this.createName = createName;
	}

	public String getAttId() {
		return attId;
	}

	public void setAttId(String attId) {
		this.attId = attId;
	}

	public String getAttName() {
		return attName;
	}

	public void setAttName(String attName) {
		this.attName = attName;
	}

	public String getAttStoreType() {
		return attStoreType;
	}

	public void setAttStoreType(String attStoreType) {
		this.attStoreType = attStoreType;
	}

	public String getAttPath() {
		return attPath;
	}

	public void setAttPath(String attPath) {
		this.attPath = attPath;
	}

	public String getCreateId() {
		return createId;
	}
	
	public String getCreateNm() {
		return EmployeeCached.getName(createId);
	}
	
	public void setCreateId(String createId) {
		this.createId = createId;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getStat() {
		return stat;
	}

	public void setStat(String stat) {
		this.stat = stat;
	}

	public String getIsOK() {
		return isOK;
	}

	public void setIsOK(String isOK) {
		this.isOK = isOK;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public byte[] getAttBlob() {
		return attBlob;
	}

	public void setAttBlob(byte[] attBlob) {
		this.attBlob = attBlob;
	}

	public String getAttClob() {
		return attClob;
	}

	public void setAttClob(String attClob) {
		this.attClob = attClob;
	}

	public String getAttRelId() {
		return attRelId;
	}

	public void setAttRelId(String attRelId) {
		this.attRelId = attRelId;
	}

	public String getRelId() {
		return relId;
	}

	public void setRelId(String relId) {
		this.relId = relId;
	}

	public String getRelType() {
		return relType;
	}

	public void setRelType(String relType) {
		this.relType = relType;
	}

	public String getOldAttPath() {
		return oldAttPath;
	}

	public void setOldAttPath(String oldAttPath) {
		this.oldAttPath = oldAttPath;
	}

	public String getResourceSign() {
		return resourceSign;
	}

	public void setResourceSign(String resourceSign) {
		this.resourceSign = resourceSign;
	}

	public String getResourceSignName() {
		if (StringUtils.isNotBlank(this.getResourceSign())) {
            return DictionaryCached.getInstance().getDictionaryName(
                    "ATTACH_SOURCE_SIGN",
                    "ATTACH_SOURCE_SIGN",
                    "ATTACH_SOURCE_SIGN",
                    this.getResourceSign());
        }
		return resourceSignName;
	}

	public void setResourceSignName(String resourceSignName) {
		this.resourceSignName = resourceSignName;
	}

	public String getResourceId() {
		return resourceId;
	}

	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}

	public String getDocumentTypeId() {
		return documentTypeId;
	}
	
	public String getDocumentTypeNm() {
		return documentTypeNm;
	}

	public void setDocumentTypeNm(String documentTypeNm) {
		this.documentTypeNm = documentTypeNm;
	}

	public void setDocumentTypeId(String documentTypeId) {
		this.documentTypeId = documentTypeId;
	}

	public String getResourceType() {
		return resourceType;
	}

	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}
	
	public String getResourceSignModule() {
		return resourceSignModule;
	}

	public void setResourceSignModule(String resourceSignModule) {
		this.resourceSignModule = resourceSignModule;
	}

	public String getPrjCode() {
		return prjCode;
	}

	public void setPrjCode(String prjCode) {
		this.prjCode = prjCode;
	}

	public String getPrjSName() {
		return prjSName;
	}

	public void setPrjSName(String prjSName) {
		this.prjSName = prjSName;
	}

	public String getPrdCode() {
		return prdCode;
	}

	public void setPrdCode(String prdCode) {
		this.prdCode = prdCode;
	}

	public String getPrdsname() {
		return prdsname;
	}

	public void setPrdsname(String prdsname) {
		this.prdsname = prdsname;
	}

	public String getExtId() {
		return extId;
	}

	public void setExtId(String extId) {
		this.extId = extId;
	}

	public String getAttrName() {
		return attrName;
	}

	public void setAttrName(String attrName) {
		this.attrName = attrName;
	}
	
	public String getAttrValue() {
		return attrValue;
	}

	public void setAttrValue(String attrValue) {
		this.attrValue = attrValue;
	}
	
	public String getAttrValueName() {
		if(StringUtils.isNotBlank(attrValue)) {
			return DictionaryCached.getDictName("ARCHIVE_TYPE", attrValue);
		}
		return attrValue;
	}

	public String getReportTime() {
		return reportTime;
	}

	public void setReportTime(String reportTime) {
		this.reportTime = reportTime;
	}

}